using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Table
{
    /// <summary>
    /// <para>Create Table</para>
    /// <para>Creates a geodatabase table or a dBASE table.</para>
    /// <para>创建地理数据库表或 dBASE 表。</para>
    /// </summary>    
    [DisplayName("Create Table")]
    public class CreateTable : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateTable()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_out_path">
        /// <para>Table Location</para>
        /// <para>The workspace in which the output table will be created.</para>
        /// <para>将在其中创建输出表的工作区。</para>
        /// </param>
        /// <param name="_out_name">
        /// <para>Table Name</para>
        /// <para>The name of the table to be created.</para>
        /// <para>要创建的表的名称。</para>
        /// </param>
        public CreateTable(object _out_path, object _out_name)
        {
            this._out_path = _out_path;
            this._out_name = _out_name;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Create Table";

        public override string CallName => "management.CreateTable";

        public override List<string> AcceptEnvironments => ["configKeyword", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_out_path, _out_name, _template, _config_keyword, _out_table, _out_alias];

        /// <summary>
        /// <para>Table Location</para>
        /// <para>The workspace in which the output table will be created.</para>
        /// <para>将在其中创建输出表的工作区。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Table Location")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_path { get; set; }


        /// <summary>
        /// <para>Table Name</para>
        /// <para>The name of the table to be created.</para>
        /// <para>要创建的表的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Table Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_name { get; set; }


        /// <summary>
        /// <para>Template Table Name</para>
        /// <para>A table with an attribute schema that is used to define the output table. Fields in the template tables will be added to the output table.</para>
        /// <para>具有用于定义输出表的属性架构的表。模板表中的字段将添加到输出表中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Template Table Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _template { get; set; } = null;


        /// <summary>
        /// <para>Configuration Keyword</para>
        /// <para>The configuration keyword that determines the storage parameters of the table in an enterprise geodatabase.</para>
        /// <para>用于确定企业级地理数据库中表的存储参数的配置关键字。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Configuration Keyword")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _config_keyword { get; set; } = null;


        /// <summary>
        /// <para>Output Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_table { get; set; }


        /// <summary>
        /// <para>Table Alias Name</para>
        /// <para>The alternate name of the output table that will be created.</para>
        /// <para>将创建的输出表的备用名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Table Alias Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_alias { get; set; } = null;


        public CreateTable SetEnv(object configKeyword = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(configKeyword: configKeyword, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}